package com.ergou.easylive.common.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * BCrypt 加密工具类
 *
 * @author Er-Gou
 * @date 2025-09-16 22:03
 */
public class PasswordEncoder {

    public static String encode(String password) {
        return PasswordEncoder().encode(password);
    }

    public static boolean matches(String rawPassword, String encodedPassword) {
        return PasswordEncoder().matches(rawPassword, encodedPassword);
    }

    public static BCryptPasswordEncoder PasswordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
